package com.briup.cms.utils;


import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;


/**
 * @program: Consult_Management_Syetem1
 * @description: 统一异常处理类
 * @author: Number 4
 * @create: 2020.07.02
 **/
@RestControllerAdvice
public class CustomerExceptionHandler {

    @ExceptionHandler(value =  Exception.class) // 捕获 Controller 中抛出的指定类型的异常，也可以指定其他异常
    public <E> Message handler(Exception exception){
        exception.printStackTrace();

        return MessageUtil.error("后台接口异常！");
    }
}
